home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4538 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.7 KB  |  112 lines

  1. Path: familynews.cycor.ca!usenet
  2. From: gcaine@cycor.ca (gcaine)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Boopsi
  5. Date: 29 Feb 1996 22:54:13 GMT
  6. Organization: Cycor Communications Inc., Coast to Coast Internet Services
  7. Message-ID: <3425.6632T1029T1644@cycor.ca>
  8. NNTP-Posting-Host: skt-as014.cycor.ca
  9. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  10.  
  11. What's the trick to getting a frame around boopsi gadgets?
  12.  
  13. I tried the example in the RKM libraries book, and the string gadget
  14. has no border. I then tried a frbuttonclass gadget, with text. I passed
  15. it the DrawInfo with the GA_DrawInfo tag, and I get the text, but that's
  16. all.
  17.  
  18. Here's a test program to show what I mean.
  19.  
  20. ----------------------------------Cut---------------------------------
  21.  
  22. #include <exec/types.h>
  23. #include <utility/tagitem.h>
  24. #include <intuition/intuition.h>
  25. #include <intuition/gadgetclass.h>
  26.  
  27. #include <proto/exec.h>
  28. #include <proto/intuition.h>
  29.  
  30. struct Window *w;
  31. struct IntuiMessage *msg;
  32. struct Gadget *testGad;
  33.  
  34.  
  35.  
  36. #define TESTGAD_ID       1L
  37. #define MINWINDOWWIDTH      80
  38. #define MINWINDOWHEIGHT     70
  39.  
  40. void main(void)
  41. {
  42.     BOOL done = FALSE;
  43.     struct DrawInfo *drawInfo = NULL;
  44.     struct Screen *pubScn = NULL;
  45.  
  46.     
  47.     if (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 37L))
  48.     {
  49.         if (pubScn = LockPubScreen(NULL))
  50.         {
  51.             if (drawInfo = GetScreenDrawInfo(pubScn))
  52.             {
  53.  
  54.                 if (w = OpenWindowTags(NULL,
  55.                     WA_Flags,       WFLG_DEPTHGADGET | WFLG_DRAGBAR |
  56.                             WFLG_CLOSEGADGET | WFLG_SIZEGADGET,
  57.                     WA_IDCMP,       IDCMP_CLOSEWINDOW | IDCMP_GADGETUP,
  58.                     WA_MinWidth,    MINWINDOWWIDTH,
  59.                     WA_MinHeight,   MINWINDOWHEIGHT,
  60.                     TAG_END))
  61.                 {
  62.                     if (testGad = (struct Gadget *)NewObject(NULL, 
  63.                         "frbuttonclass",
  64.                         GA_ID,          TESTGAD_ID,
  65.                         GA_Top,         (w->BorderTop) + 10L,
  66.                         GA_Left,        (w->BorderLeft) + 5L,
  67.                         GA_Width,       25,
  68.                         GA_Height,      12,
  69.                         GA_DrawInfo,    drawInfo,
  70.                         GA_Text,        (ULONG)"Test",
  71.                         TAG_END))
  72.  
  73.                     {
  74.                                                         
  75.                         AddGList(w, testGad, -1, -1, NULL);
  76.                         RefreshGList(testGad, w, NULL, -1);
  77.                     
  78.                         while (done == FALSE)
  79.                         {
  80.                             WaitPort((struct MsgPort *)w->UserPort);
  81.                             while (msg = (struct IntuiMessage *)
  82.                             GetMsg((struct MsgPort *)w->UserPort))
  83.                             {
  84.                                 if (msg->Class == IDCMP_CLOSEWINDOW)
  85.                                 done = TRUE;
  86.                                 ReplyMsg((struct Message *)msg);
  87.                             }
  88.                         }
  89.                         RemoveGList(w, testGad, -1);
  90.                         DisposeObject(testGad);
  91.                     }
  92.                     CloseWindow(w);
  93.                 }
  94.                 FreeScreenDrawInfo(pubScn, drawInfo);
  95.                 drawInfo = NULL;
  96.             }
  97.             
  98.             UnlockPubScreen(NULL, pubScn);
  99.             pubScn = NULL;
  100.         }
  101.         CloseLibrary((struct Library *)IntuitionBase);
  102.     }
  103. }
  104. --------------------------------End Cut-------------------------------
  105.  
  106. I've just started playing with boopsi now, but I could use some help.
  107.  
  108. Does anyone know where I can get some more documentation, or tutorials?
  109.  
  110. Gary Caine    Member: Team AMIGA
  111.  
  112.